package com.fish.gaiety.gateway.service.impl;

import com.fish.gaiety.gateway.service.AuditService;
import com.fish.gaiety.gateway.service.ExternalSystemService;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
@Slf4j
public class AuditServiceImpl implements AuditService {

    private final ExternalSystemService externalSystemService;

    @SneakyThrows
    @Override
    @Async
    public void audit(String auditLog) {
        // 增加一些线程沉睡时间来模仿审计时间花费
        Thread.sleep(3000L);
        log.info("log audit...: {}", auditLog);
    }
}
